<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
</head>
<body>
<script type="text/javascript">
function onBridgeReady(){
   WeixinJSBridge.invoke('getBrandWCPayRequest', {
  		"appId": "${requestMap.appId}",
  		"timeStamp": "${requestMap.timeStamp}",
  		"nonceStr": "${requestMap.nonceStr}",
  		"package": "${requestMap.package}",
  		"signType": "${requestMap.signType}",
  		"paySign": "${requestMap.paySign}"
	}, function(res){
         if(res.err_msg == "get_brand_wcpay_request:ok" ) {
         	document.location = "${app_order_return}";
         }
         if(res.err_msg == "get_brand_wcpay_request:cancel" ) {
         	window.history.back();
         } 
         if(res.err_msg == "get_brand_wcpay_request:fail" ) {
         	document.location = "${app_order_return}";
         } 
    });
}
if (typeof WeixinJSBridge == "undefined"){
   if( document.addEventListener ) {
       document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
   } else if (document.attachEvent){
       document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
       document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
   }
}else{
   onBridgeReady();
}
</script>
</body>
</html>